Added a "grab_focus" signal for widgets. When the signal is emitted, the
authorFederico Mena Quintero <federico@nuclecu.unam.mx>
Mon, 14 Dec 1998 01:32:24 +0000 (01:32 +0000)
committerArturo Espinosa <unammx@src.gnome.org>
Mon, 14 Dec 1998 01:32:24 +0000 (01:32 +0000)
1998-12-13  Federico Mena Quintero  <federico@nuclecu.unam.mx>

* gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
signal for widgets.  When the signal is emitted, the widget will
grab the focus.  This is needed to let the user press an
accelerator key in a dialog box and have the corresponding widget
be focused.

* gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
signal.  The default handler is simply gtk_widget_grab_focus().

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkwidget.c
gtk/gtkwidget.h

index 84aff68b8f7bf391267677bfadbc514ea9da4ab5..39052ae0c01a0c7c6ff3cf49739bc0a1950a9622 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+1998-12-13  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
+       signal for widgets.  When the signal is emitted, the widget will
+       grab the focus.  This is needed to let the user press an
+       accelerator key in a dialog box and have the corresponding widget
+       be focused.
+
+       * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
+       signal.  The default handler is simply gtk_widget_grab_focus().
+
 Sun Dec 13 22:15:48 GMT 1998  Tony Gale  <gale@gtk.org>
 
        * docs/gtk_tut.sgml: Update the following sections to the
index 84aff68b8f7bf391267677bfadbc514ea9da4ab5..39052ae0c01a0c7c6ff3cf49739bc0a1950a9622 100644 (file)
@@ -1,3 +1,14 @@
+1998-12-13  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
+       signal for widgets.  When the signal is emitted, the widget will
+       grab the focus.  This is needed to let the user press an
+       accelerator key in a dialog box and have the corresponding widget
+       be focused.
+
+       * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
+       signal.  The default handler is simply gtk_widget_grab_focus().
+
 Sun Dec 13 22:15:48 GMT 1998  Tony Gale  <gale@gtk.org>
 
        * docs/gtk_tut.sgml: Update the following sections to the
index 84aff68b8f7bf391267677bfadbc514ea9da4ab5..39052ae0c01a0c7c6ff3cf49739bc0a1950a9622 100644 (file)
@@ -1,3 +1,14 @@
+1998-12-13  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
+       signal for widgets.  When the signal is emitted, the widget will
+       grab the focus.  This is needed to let the user press an
+       accelerator key in a dialog box and have the corresponding widget
+       be focused.
+
+       * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
+       signal.  The default handler is simply gtk_widget_grab_focus().
+
 Sun Dec 13 22:15:48 GMT 1998  Tony Gale  <gale@gtk.org>
 
        * docs/gtk_tut.sgml: Update the following sections to the
index 84aff68b8f7bf391267677bfadbc514ea9da4ab5..39052ae0c01a0c7c6ff3cf49739bc0a1950a9622 100644 (file)
@@ -1,3 +1,14 @@
+1998-12-13  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
+       signal for widgets.  When the signal is emitted, the widget will
+       grab the focus.  This is needed to let the user press an
+       accelerator key in a dialog box and have the corresponding widget
+       be focused.
+
+       * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
+       signal.  The default handler is simply gtk_widget_grab_focus().
+
 Sun Dec 13 22:15:48 GMT 1998  Tony Gale  <gale@gtk.org>
 
        * docs/gtk_tut.sgml: Update the following sections to the
index 84aff68b8f7bf391267677bfadbc514ea9da4ab5..39052ae0c01a0c7c6ff3cf49739bc0a1950a9622 100644 (file)
@@ -1,3 +1,14 @@
+1998-12-13  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
+       signal for widgets.  When the signal is emitted, the widget will
+       grab the focus.  This is needed to let the user press an
+       accelerator key in a dialog box and have the corresponding widget
+       be focused.
+
+       * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
+       signal.  The default handler is simply gtk_widget_grab_focus().
+
 Sun Dec 13 22:15:48 GMT 1998  Tony Gale  <gale@gtk.org>
 
        * docs/gtk_tut.sgml: Update the following sections to the
index 84aff68b8f7bf391267677bfadbc514ea9da4ab5..39052ae0c01a0c7c6ff3cf49739bc0a1950a9622 100644 (file)
@@ -1,3 +1,14 @@
+1998-12-13  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
+       signal for widgets.  When the signal is emitted, the widget will
+       grab the focus.  This is needed to let the user press an
+       accelerator key in a dialog box and have the corresponding widget
+       be focused.
+
+       * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
+       signal.  The default handler is simply gtk_widget_grab_focus().
+
 Sun Dec 13 22:15:48 GMT 1998  Tony Gale  <gale@gtk.org>
 
        * docs/gtk_tut.sgml: Update the following sections to the
index 84aff68b8f7bf391267677bfadbc514ea9da4ab5..39052ae0c01a0c7c6ff3cf49739bc0a1950a9622 100644 (file)
@@ -1,3 +1,14 @@
+1998-12-13  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkwidget.h (struct _GtkWidgetClass): Added a "grab_focus"
+       signal for widgets.  When the signal is emitted, the widget will
+       grab the focus.  This is needed to let the user press an
+       accelerator key in a dialog box and have the corresponding widget
+       be focused.
+
+       * gtk/gtkwidget.c (gtk_widget_class_init): Create the "grab_focus"
+       signal.  The default handler is simply gtk_widget_grab_focus().
+
 Sun Dec 13 22:15:48 GMT 1998  Tony Gale  <gale@gtk.org>
 
        * docs/gtk_tut.sgml: Update the following sections to the
index 9a400079d267b084f54aa0859698db6d95ab4e76..b0797fe66d2698577976394bbda62954b2dfc32a 100644 (file)
@@ -52,6 +52,7 @@ enum {
   STYLE_SET,
   ADD_ACCELERATOR,
   REMOVE_ACCELERATOR,
+  GRAB_FOCUS,
   EVENT,
   BUTTON_PRESS_EVENT,
   BUTTON_RELEASE_EVENT,
@@ -387,6 +388,13 @@ gtk_widget_class_init (GtkWidgetClass *klass)
   widget_signals[REMOVE_ACCELERATOR] =
     gtk_accel_group_create_remove (object_class->type, GTK_RUN_LAST,
                                   GTK_SIGNAL_OFFSET (GtkWidgetClass, remove_accelerator));
+  widget_signals[GRAB_FOCUS] =
+    gtk_signal_new ("grab_focus",
+                   GTK_RUN_FIRST,
+                   object_class->type,
+                   GTK_SIGNAL_OFFSET (GtkWidgetClass, grab_focus),
+                   gtk_marshal_NONE__NONE,
+                   GTK_TYPE_NONE, 0);
   widget_signals[EVENT] =
     gtk_signal_new ("event",
                    GTK_RUN_LAST,
@@ -721,6 +729,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
   klass->style_set = gtk_widget_style_set;
   klass->add_accelerator = (void*) gtk_accel_group_handle_add;
   klass->remove_accelerator = (void*) gtk_accel_group_handle_remove;
+  klass->grab_focus = gtk_widget_grab_focus;
   klass->event = NULL;
   klass->button_press_event = NULL;
   klass->button_release_event = NULL;
index 186e62c0bdddfda622f8dced754717178ef28eb3..295a29fc34572c37fb748ec7c77b9a35fdd9947d 100644 (file)
@@ -272,6 +272,9 @@ struct _GtkWidgetClass
                                GtkAccelGroup  *accel_group,
                                guint           accel_key,
                                GdkModifierType accel_mods);
+
+  /* explicit focus */
+  void (* grab_focus)          (GtkWidget      *widget);
   
   /* events */
   gint (* event)                  (GtkWidget          *widget,